package com.jed.dao;

import org.jeecgframework.minidao.annotation.Param;
import org.jeecgframework.minidao.annotation.Sql;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface UserDao {

	/**根据安全码查找用户（APP端）*/
	@Sql("SELECT id,password,realname,username,securit_code as securitCode "
			+ "FROM [dbo].[t_s_base_user] WHERE securit_code=:securitCode")
	public Map<String, Object> getUserByKey(@Param("securitCode") String securitCode);
	
	/**根据用户名密码查找用户*/
	@Sql("SELECT id,password,realname,username,securit_code as securitCode "
			+ "FROM [dbo].[t_s_base_user] WHERE username=:username AND password=:password")
	public List<Map<String, Object>> getUserByName(
            @Param("username") String username,
            @Param("password") String password);

	/**更新安全码（APP端）*/
	@Sql("UPDATE [dbo].[t_s_base_user] SET [securit_code] =:securitCode WHERE id= :id")
	public Integer updateUser(@Param("id") String id, @Param("securitCode") String securitCode);

}
